package org.beian.fmmall.service.Impl;

import org.beian.fmmall.VO.ResStatus;
import org.beian.fmmall.VO.ResultVO;
import org.beian.fmmall.beans.CategoryRecommendVO;
import org.beian.fmmall.beans.CategoryVO;
import org.beian.fmmall.dao.CategoryMapper;
import org.beian.fmmall.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    private CategoryMapper categoryMapper;
    @Override
    public ResultVO listCategories() {
        List<CategoryVO> categoryVOS = categoryMapper.selectAllCategories();
        return new ResultVO(ResStatus.OK,"success",categoryVOS);
    }

    @Override
    public ResultVO listTop6Categories() {
        List<CategoryRecommendVO> categoryRecommendVOS = categoryMapper.select1strecommendCategories();
        return new ResultVO(ResStatus.OK,"success",categoryRecommendVOS);
    }
}
